function getArticleMsgByPage(categoryID){
		
		var params = "categoryID="+categoryID;
		var pageUrl='../MicroSite/queryArticleByModel.htm';				
		$("#paging").asynPage(pageUrl,params,'#tbodyPage',buildHtml,10,'rows','total');	
	}
	

//异步分页
function buildHtml(data){	
	var str ="";
	if(data!=null && data.length>0){		    		
		for (var i=0;i<data.length;i++)
		{
			var d = data[i].createDate;
			 var test = new Date(parseInt(d));  
			 var _year = test.getFullYear();  
			 var _month = parseInt(test.getMonth())+1;  
			 var _day = test.getDate();  

			str+="<div class='corner_wrap'>";
			str+="	<div class='date'>";
			str+="       <span class='month'>"+_month+"</span>";
			str+="       <span class='day'>"+_day+"</span>";
			str+="       <span class='year'>"+_year+"</span>";
			str+="   </div>";
			str+="   <h2><a href='../MicroSite/detailArticleInterface.html?id="+data[i].id+"'>"+data[i].title+"</a></h2>";
			str+="   <div class='clear'></div>";
			str+=" </div>";
			
			str+="<div class='shadow_wrap'></div>";
		}
		$("#tbodyPage").append(str);			    		
	}else{
		$("#tbodyPage").append('没有符合条件的数据!');
	}			
}



	function getArticleCategoryByPage(categoryID){
		
		var params = "parentID="+categoryID;
		var pageUrl='../MicroSite/getArticleCategoryByPage.htm';				
		$("#paging").asynPage(pageUrl,params,'#tbodyPage',buildHtmlToogleWrap,10,'rows','total');	
	}

	
	function buildHtmlToogleWrap(data)
	{
		var str="";
		if(data!=null && data.length>0)
		{	
			for(var i=0; i< data.length; i++)
			{
				str+="<div class='toogle_wrap'>";
				str+="<div class='trigger' onclick='changerToggleClass(this)' ><a href='#'>"+data[i].name+"</a></div>";
				str+="<div style='display: none;' class='toggle_container'>";
				str+="<ul>";
				
				str += loadArticleByParentArticleCategory(data[i].id);
				
					
				str+="</ul>";
				str+="</div>";
				str+="</div>";
				
				str+="<div class='shadow_wrap'></div>";
			}
			$("#tbodyPage").append(str);	
		}else
		{
			$("#tbodyPage").append('没有符合条件的数据!');
		}
	}
	
	
	function changerToggleClass(obj)
	{
		
		$(obj).toggleClass("active").next().slideToggle("slow");
	}

	
	
	
	//根据父目录查询所有的 子目录 下的文章.
	function loadArticleByParentArticleCategory(id )
	{
		var str="";
		$.ajax({  
			type: "POST",  
	        url: '../MicroSite/loadArticleByParentArticleCategory.json',  
	        async: false,
	        data:{  
	        	categoryID:id,
		    },  
		    cache:false,  
		    dataType:'json',  
		    success:function(data) { 
		    	if(data!=null && data.length>0){
		    		for(var i = 0; i< data.length; i++)
		    			{
			    			str+="<li><a href='../MicroSite/detailArticleInterface.html?id="+data[i].id+"'>"+data[i].title+"</a></li>";
		    			}
		    	}	
		    },  
		     error : function(XMLHttpRequest, textStatus, errorThrown) {  
		          XMLHttpRequest.status;
		          XMLHttpRequest.readyState;
		          textStatus;
		     }  
		});
		
		return str;
	}
	
	
	
	//底部导航菜单.
	function categoryMenu(categoryID)
	{
	
		$.ajax({  
			type: "POST",  
	        url: '../MicroSite/getArticleCategoryByPage.htm',  
	        async: false,
	        data:{  
	        	parentID:categoryID,
		    },  
		    cache:false,  
		    dataType:'json',  
		    success:function(data) { 
		    	if(data!=null && data.total>0){
		    		var str = "";
		    		var n = 0;
		    		for(var i = 0; i< data.total; i++)
		    		{
		    			if(i % 2 == 0)
		    			{
		    				str+="<li class='screen' data-index='"+n+"' style='width: 413px; left: "+n*413+"px; transition: all 0ms ease 0s; transform: translateX("+n*413+"px);'>";
		    				str+="<div class='index_con white'>";
		    			}
		    			n++;
		    			str+="<div class='box ratio4_3'>";
		    			str+="<div class='box-content'>";
		    			str+="<a href='#'  onclick='getArticleMsgByCategoryID("+data.rows[i].id+")'><p>";
		    			str+="<span>"+data.rows[i].name+"</span>";
		    			str+="</p></a>";
		    			str+="</div>";
		    			str+="</div>";
		    			if((i != 0)  && (i % 2 == 0  || i == (data.total - 1)))
		    			{
		    				str+="</div>";
		    				str+="</li>";
		    			}
		    		}
		    		$("#menu_li").append(str);
		    	}	
		    },  
		     error : function(XMLHttpRequest, textStatus, errorThrown) {  
		          XMLHttpRequest.status;
		          XMLHttpRequest.readyState;
		          textStatus;
		     }  
		});
	}
	
	
	
	/**
	 * 查跟目录下的所有文章.
	 * @param categoryID
	 */
	function getArticleMsgByCategoryID(categoryID){	
		var params = "categoryID="+categoryID;
		var pageUrl='../MicroSite/loadArticleByParentArticleCategoryByPage.htm';				
		$("#paging").asynPage(pageUrl,params,'#tbodyPage',buildHtml,5,'rows','total');	
	}
	
	